import { Action } from "@ngrx/store";
import { BufferOptions, InputMarkOptions } from "../reducers";

export enum DrawToolTypes {
    SELECT = 'Select',
    POINT = 'Point',
    LINESTRING = 'LineString',
    CIRCLE = 'Circle',
    RECTANGLE = 'Rectangle',
    POLYGON = 'Polygon',
    INPUTMARK = 'InputMark',
    BUFFER = 'Buffer',
    REMOVE = 'Remove',
    CLEAN = 'Clean'
}

export enum DrawToolActionTypes {
    DRAW_TOOL_DISABLED = '[Draw Tool] Draw Tool Disabled!',
    DRAW_TOOL_ENABLED = '[Draw Tool] Draw Tool Enabled!',
    DRAW_TOOL_ACTIVE = '[Draw Tool] Draw Tool Active!',
    DRAW_TOOL_DEACTIVE = '[Draw Tool] Draw Tool Deactive!',
    DRAW_TOOL_DEACTIVE_ALL = '[Draw Tool] Draw Tool Deactive All!',
    DRAW_TOOL_MEASURE_AVAILABLE = '[Draw Tool] Draw Tool Measure Available!',
    DRAW_TOOL_BUFFER = '[Draw Tool] Draw Tool Buffer!',
    DRAW_TOOL_INPUT_MARK = '[Draw Tool] Draw Tool Input Mark!',
}

export class DrawToolActive implements Action {
    readonly type = DrawToolActionTypes.DRAW_TOOL_ACTIVE;
    constructor(public payload: DrawToolTypes) {}
}

export class DrawToolDeactive implements Action {
    readonly type = DrawToolActionTypes.DRAW_TOOL_DEACTIVE;
    constructor(public payload: DrawToolTypes) {}
}

export class DrawToolDeactiveAll implements Action {
    readonly type = DrawToolActionTypes.DRAW_TOOL_DEACTIVE_ALL;
    constructor() {}
}

export class DrawToolDisabled implements Action {
    readonly type = DrawToolActionTypes.DRAW_TOOL_DISABLED;
    constructor(public payload: DrawToolTypes) {}
}

export class DrawToolEnabled implements Action {
    readonly type = DrawToolActionTypes.DRAW_TOOL_ENABLED;
    constructor(public payload: DrawToolTypes) {}
}

export class DrawToolMeasureAvailable implements Action {
    readonly type = DrawToolActionTypes.DRAW_TOOL_MEASURE_AVAILABLE;
    constructor(public payload: boolean) {}
}

export class DrawToolBuffer implements Action {
    readonly type = DrawToolActionTypes.DRAW_TOOL_BUFFER;
    constructor(public payload: BufferOptions) {}
}

export class DrawToolInputMark implements Action {
    readonly type = DrawToolActionTypes.DRAW_TOOL_INPUT_MARK;
    constructor(public payload: InputMarkOptions) {}
}


export type DrawToolAction
    = DrawToolActive
    | DrawToolDeactive
    | DrawToolDeactiveAll
    | DrawToolDisabled
    | DrawToolEnabled
    | DrawToolMeasureAvailable
    | DrawToolBuffer
    | DrawToolInputMark;


